<!--
  @author yangjiangming
  @date 2018-12-10 20:40:28
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html th:replace="~{work/modify/common/layout :: layout('优惠', ~{::title}, ~{::content}, ~{::script})}"
      xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <title>工单管理-优惠</title>
</head>
<body>

<div th:fragment="content">
    <form action="" class="layui-form">
        <input type="hidden" id="casSign" name="casSign" th:value="${casSign}"/>
        <input type="hidden" name="operateId" th:value="${discountVO.operateId}">
        <input type="hidden" name="orderId" th:value="${discountVO.orderId}">
        <input type="hidden" name="workId" th:value="${discountVO.workId}">

        <div class="layui-form-item">
            <label class="layui-form-label" style="width: 80px">优惠类型</label>
            <div class="layui-inline">
                <input type="radio" name="disCategory" lay-filter="disCategory" lay-verify="required" value="1" title="人工优惠" checked="checked" />
                <input th:if="${discountVO.supportMtCoupon}" type="radio" name="disCategory" lay-filter="disCategory" lay-verify="required" value="10" title="美团"/>
                <input th:if="${discountVO.supportKbCoupon}" type="radio" name="disCategory" lay-filter="disCategory" lay-verify="required" value="20" title="口碑"/>
            </div>
        </div>
        <div id="dvDiscountAmt" class="layui-form-item">
            <label class="layui-form-label" style="width: 80px">优惠金额</label>
            <div class="layui-inline">
                    <input
                    class="layui-input"
                    type="text"
                    name="discountAmount"
                    id="discountAmount"
                    lay-verify="required|user-number"
                    style="width: 200px"
                    th:value="${#moneyUtil.parseToYuan(discountVO.discountAmount)}">
            </div>
            <div class="layui-inline">
                优惠限制 0 ~ <span th:text="|${#moneyUtil.parseToYuan(discountVO.maxDiscountAmount)} 元|"> 填：0表示删除优惠</span>
            </div>
        </div>

        <div id="dvCoupon"  class="layui-form-item" style="display: none">
            <label class="layui-form-label" style="width: 80px">优惠券码</label>
            <div class="layui-inline">
                <input
                        class="layui-input"
                        type="text"
                        name="couponCode"
                        id="couponCode"
                        lay-verify=""
                        style="width: 200px">
            </div>
            <div class="layui-inline" th:unless="${isMaxDiscount}">
                后台验券，支持全品类；验券后，不支持返还；请谨慎操作。
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label" style="width: 80px">缘由</label>
            <div class="layui-inline" style="width: 800px;">
                <textarea name="operatorRemark" class="layui-textarea" placeholder="请填写缘由，不超过1000字"></textarea>
                <div class="layui-form-item" style="text-align: center;margin-top: 20px;">
                    <div class="layui-inline">
                        <button class="layui-btn layui-bg-green" lay-submit="">保存</button>
                        <button class="layui-btn layui-btn-primary" type="reset">取消</button>
                    </div>
                </div>
            </div>
        </div>
    </form>
</div>

<script th:inline="javascript">

    var discountVO = [[${discountVO}]];
   var layuiModel={
        oms_work_modify_discount: "work/modify/zmn.oms.work.modify.discount"
    }
</script>
</body>
</html>
